<?php include('header.php'); ?>
<script type="text/javascript">
$(document).ready(function() {
	$('#country_id').change(function(){
		populate_zone_menu();
	});	

});
// context is ship or bill
function populate_zone_menu(value)
{
	$.post('<?php echo site_url('locations/get_zone_menu');?>',{id:$('#country_id').val()}, function(data) {
		$('#zone_id').html(data);
	});
}
</script>
<div class="row">
	<div class="span3">	
		&nbsp;<?php //echo '<img width=70% src="'.base_url('uploads/AA kecil.png').'" />'?>
	</div>
	<div class="span7">	
		<?php 
		$address_form_prefix = 'bill';
		$countries = $this->Location_model->get_countries_menu();

		if(!empty($customer[$address_form_prefix.'_address']['country_id']))
		{
			$zone_menu	= $this->Location_model->get_zones_menu($customer[$address_form_prefix.'_address']['country_id']);
		}
		else
		{
			$zone_menu = array(''=>'')+$this->Location_model->get_zones_menu(array_shift(array_keys($countries)));
		}
		?>
		
		<br />
		<?php echo form_open('cart/list_res');?>
		<div class="span2">
		<?php 
		echo form_dropdown('country_id',$countries, @$customer[$address_form_prefix.'_address']['country_id'], 'id="country_id" class="form-control"');
		?>
		</div>
		&nbsp;
		<div class="span2">
		<?php
		echo form_dropdown('zone_id',$zone_menu, @$customer[$address_form_prefix.'_address']['zone_id'], 'id="zone_id" class="form-control"');
		?>
		</div>
		<div class="span2">
		<input type="text" name="term" class="search-query span2" placeholder="<?php echo lang('search');?>"/>
		</div>
	</div>
	<div class="span12">
		<center>
		<?php echo '<img width="80%"  src="'.base_url('uploads/Lan.png').'" />'; ?>
		</center>
	</div>
	<div class="span12">
		<br />
	</div>
	<center>
	<div class="span8">
		<br />
		<div id="myCarousel" class="carousel slide">
			<!-- Carousel items -->
			<center>
			<div class="carousel-inner">
				<?php
				$active_banner	= 'active ';
				foreach($banners as $banner):?>
					<div class="<?php echo $active_banner;?>item">
						<?php
						
						$banner_image	= '<center><img class=img-polaroid src="'.base_url('uploads/'.$banner->image).'" width="90%" height="350px"/></center>';
						if($banner->link)
						{
							$target=false;
							if($banner->new_window)
							{
								$target=' target="_blank"';
							}
							echo '<a href="'.$banner->link.'"'.$target.'>'.$banner_image.'</a>';
						}
						else
						{
							echo $banner_image;
						}
						?>
					
					</div>
				<?php 
				$active_banner = false;
				endforeach;?>
			</div>
			<center>
			<a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
			<a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
		
		</div>
	</div>
</div>

<script type="text/javascript">
$('.carousel').carousel({
  interval: 5000
});
</script>


<?php include('footer.php'); ?>